/*
 * @Descripttion: 
 * @Author: xiaodong
 * @Date: 2020-09-17 15:11:28
 */
import './utils/public-path';
import Vue from 'vue';
import axios from 'axios';
import '@/assets/styles/base/base.css';
import '@/assets/styles/base/baseClass.scss';
import { lifeCycle, render  } from './utils/life-cycle';
import {ApiService,Authority} from 'cloud-common';
import { $cloudMessage,$cloudConfirm } from 'cloud-components';


//--------  注册全局过滤器 -------------
import filters from 'cloud-common/tool/filter.js';
Object.keys(filters).forEach(k => Vue.filter(k, filters[k]));

Vue.prototype.$checkAuth =new Authority('tool').checkAuth;

//--------  注册接口服务  ----------------
// import './mock'//注册Mockjs
Vue.prototype.api = new ApiService(axios,$cloudMessage,$cloudConfirm,'/tool');
Vue.prototype.$http = axios;
//--------  注册接口服务结束  ----------------

//--------  注册字体图标库组件 ---------------
import AppIcon from 'cloud-common/business/AppIcon';
import 'cloud-common/assets/fonts/iconfont.js';
Vue.component('app-icon', AppIcon);


import { CloudLoading, CloudMessage, CloudConfirm } from 'cloud-components';

Vue.use(CloudLoading);
Vue.use(CloudMessage);
Vue.use(CloudConfirm);

Vue.config.productionTip = false;

/**
 *  @description  单独环境直接实例化vue
 */
const __qiankun__ = window.__POWERED_BY_QIANKUN__;
__qiankun__ || render();

/**
 *  @description  导出微应用生命周期
 */
const { bootstrap, mount, unmount } = lifeCycle();
export { bootstrap, mount, unmount };